import request from "./request"

//获取视频流列表
export function getVideoPlayerList() {
	return request({
		url: '/api/stream/list',
		method: 'get'
	})
}

//获取视频页面右侧检察院列表
export function getTreeList() {
	return request({
		url: '/fly/prt/getUserCode?userCode=140000',
		method: 'get'
	})
}

/**
 * @description 开始录制视频
 * @param id 视频的id
 * @return {AxiosPromise}
 */
export function startRecord({id}) {
	return request({
		url: '/api/stream/startRecord',
		method: 'get',
		params: {
			id
		}
	})
}

/**
 * @description 停止录制直播
 * @param id
 * @return {AxiosPromise}
 */
export function stopRecord({id}) {
	return request({
		url: '/api/stream/stopRecord',
		method: 'get',
		params: {
			id
		}
	})
}

/**
 * @description 获取融云的token
 * @return {AxiosPromise}
 */
export function getUserToken() {
	return request({
		url: '/api/rongCloud/getToken',
		method: 'get'
	})
}

/**
 * @description 接通飞手信息
 * @param userId
 * @return {AxiosPromise}
 */
export function contactSuccess(userId) {
	return request({
		url: '/api/appUser/callVoice',
		method: 'get',
		params: {
			userId
		}
	})
}

/**
 * @description 断掉飞手信息
 * @param userId
 * @return {AxiosPromise}
 */
export function cancelSuccess(userId) {
	return request({
		url: '/api/appUser/dismissVoice',
		method: 'get',
		params: {
			userId
		}
	})
}

/**
 * @description 获取飞手信息
 * @return {AxiosPromise}
 */
export function getContactList() {
	return request({
		url: '/api/appUser/online',
		method: 'get'
	})
}
